import i18next from 'i18next'
const { t } = i18next

export const enum KEYS {
  C = 'C',
  X = 'X',
  Z = 'Z',
  Y = 'Y',
  A = 'A',
  G = 'G',
  L = 'L',
  F = 'F',
  D = 'D',
  B = 'B',
  P = 'P',
  MINUS = '-',
  EQUAL = '=',
  DIGIT_0 = '0',
  DELETE = 'DELETE',
  UP = 'ARROWUP',
  DOWN = 'ARROWDOWN',
  LEFT = 'ARROWLEFT',
  RIGHT = 'ARROWRIGHT',
  ENTER = 'ENTER',
  SPACE = ' ',
  TAB = 'TAB',
  BACKSPACE = 'BACKSPACE',
  ESC = 'ESCAPE',
  PAGEUP = 'PAGEUP',
  PAGEDOWN = 'PAGEDOWN',
  F5 = 'F5',
}

export const HOTKEY_DOC = () => [
  {
    type: t('hotkey.general.general'),
    children: [
      { label: t('hotkey.general.cut'), value: 'Ctrl + X' },
      { label: t('hotkey.general.copy'), value: 'Ctrl + C' },
      { label: t('hotkey.general.paste'), value: 'Ctrl + V' },
      { label: t('hotkey.general.pasteAsPlainText'), value: 'Ctrl + Shift + V' },
      { label: t('hotkey.general.quickCopyAndPaste'), value: 'Ctrl + D' },
      { label: t('hotkey.general.selectAll'), value: 'Ctrl + A' },
      { label: t('hotkey.general.undo'), value: 'Ctrl + Z' },
      { label: t('hotkey.general.redo'), value: 'Ctrl + Y' },
      { label: t('hotkey.general.delete'), value: 'Delete / Backspace' },
      { label: t('hotkey.general.multiSelect'), value: t('hotkey.holdDownCtrlOrShift') },
      { label: t('hotkey.general.openSearchAndReplace'), value: 'Ctrl + F' },
      { label: t('hotkey.general.print'), value: 'Ctrl + P' },
      { label: t('hotkey.general.closeDialog'), value: 'ESC' },
    ],
  },
  {
    type: t('hotkey.slideShow.slideShow'),
    children: [
      { label: t('hotkey.slideShow.startSlideShowFromBeginning'), value: 'F5' },
      { label: t('hotkey.slideShow.startSlideShowFromCurrentSlide'), value: 'Shift + F5' },
      { label: t('hotkey.slideShow.goToPreviousSlide'), value: '↑ / ← / PgUp' },
      { label: t('hotkey.slideShow.goToNextSlide'), value: '↓ / → / PgDown' },
      { label: t('hotkey.slideShow.goToNextSlide'), value: 'Enter / Space' },
      { label: t('hotkey.slideShow.exitSlideShow'), value: 'ESC' },
    ],
  },
  {
    type: t('hotkey.slideEdit.slideEdit'),
    children: [
      { label: t('hotkey.slideEdit.newSlide'), value: 'Enter' },
      { label: t('hotkey.slideEdit.moveCanvas'), value: 'Space + ' + t('hotkey.slideEdit.mouseDrag') },
      { label: t('hotkey.slideEdit.zoomCanvas'), value: 'Ctrl + ' + t('hotkey.slideEdit.mouseScrollWheel') },
      { label: t('hotkey.slideEdit.zoomIn'), value: 'Ctrl + =' },
      { label: t('hotkey.slideEdit.zoomOut'), value: 'Ctrl + -' },
      { label: t('hotkey.slideEdit.fitCanvasToScreen'), value: 'Ctrl + 0' },
      { label: t('hotkey.slideEdit.goToPreviousSlide'), value: '↑ / ←' },
      { label: t('hotkey.slideEdit.goToNextSlide'), value: '↓ / →' },
      { label: t('hotkey.slideEdit.previousSlide'), value: t('hotkey.slideEdit.mouseScrollUp') + ' / PgUp' },
      { label: t('hotkey.slideEdit.nextSlide'), value: t('hotkey.slideEdit.mouseScrollDown') + ' / PgDown' },
    ],
  },
  {
    type: t('hotkey.elementOperation.elementOperation'),
    children: [
      { label: t('hotkey.elementOperation.move'), value: '↑ / ← / ↓ / →' },
      { label: t('hotkey.elementOperation.lock'), value: 'Ctrl + L' },
      { label: t('hotkey.elementOperation.group'), value: 'Ctrl + G' },
      { label: t('hotkey.elementOperation.ungroup'), value: 'Ctrl + Shift + G' },
      { label: t('hotkey.elementOperation.bringToFront'), value: 'Alt + F' },
      { label: t('hotkey.elementOperation.sendToBack'), value: 'Alt + B' },
      { label: t('hotkey.elementOperation.lockAspectRatio'), value: t('hotkey.holdDownCtrlOrShift') },
      { label: t('hotkey.elementOperation.createHorizontalOrVerticalLine'), value: t('hotkey.holdDownCtrlOrShift') },
      { label: t('hotkey.elementOperation.switchFocusedElement'), value: 'Tab' },
      { label: t('hotkey.elementOperation.confirmImageCrop'), value: 'Enter' },
      { label: t('hotkey.elementOperation.completeCustomShapeDrawing'), value: 'Enter' },
    ],
  },
  {
    type: t('hotkey.tableEdit.tableEdit'),
    children: [
      { label: t('hotkey.tableEdit.focusNextCell'), value: 'Tab' },
      { label: t('hotkey.tableEdit.insertRowAbove'), value: 'Ctrl + ↑' },
      { label: t('hotkey.tableEdit.insertRowBelow'), value: 'Ctrl + ↓' },
      { label: t('hotkey.tableEdit.insertColumnToLeft'), value: 'Ctrl + ←' },
      { label: t('hotkey.tableEdit.insertColumnToRight'), value: 'Ctrl + →' },
    ],
  },
  {
    type: t('hotkey.chartDataEdit.chartDataEdit'),
    children: [
      { label: t('hotkey.chartDataEdit.focusNextRow'), value: 'Enter' },
    ],
  },
  {
    type: t('hotkey.textEdit.textEdit'),
    children: [
      { label: t('hotkey.textEdit.bold'), value: 'Ctrl + B' },
      { label: t('hotkey.textEdit.italic'), value: 'Ctrl + I' },
      { label: t('hotkey.textEdit.underline'), value: 'Ctrl + U' },
      { label: t('hotkey.textEdit.inlineCode'), value: 'Ctrl + E' },
      { label: t('hotkey.textEdit.superscript'), value: 'Ctrl + ;' },
      { label: t('hotkey.textEdit.subscript'), value: `Ctrl + '` },
      { label: t('hotkey.textEdit.selectParagraph'), value: `ESC` },
    ],
  },
]